include(/mnt/Datos/Facultad/Latex/circuit_macros/pgf.m4)
include(/mnt/Datos/Facultad/Latex/circuit_macros/libcct.m4)
   
.PS 
cct_init
  
elen = 0.75
Origin: Here
	ground
	source(up_ elen*0.5, AC); llabel(,v_{s},)
	resistor(up_ elen*0.7); rlabel(,R_{s},)
	capacitor(right_ elen); llabel(, C_{s},)
	{
		line right_ elen*0.3
		TBJ:bi_tr(up_ dimen_) with .B at Here; ;rlabel(,BC548B,)
		line up_ 0.5 from TBJ.C
		POS: Here
		line up_ 0.1 
		dot; rlabel(,V_{DD},)
		resistor(down_ from TBJ.E); llabel(,R_{E},)
		POS2:Here
	}
	{
		resistor(up_ elen); llabel(,R_{B1},)
		line right_ to POS
	}
	{
		resistor(down_ elen); rlabel(R_{B2},)
		line right_ to POS2
		line down_ 0.1
		dot; llabel(,-V_{SS},)
	}

	# Sigo con la segunda etapa
	line right_ from TBJ.E to (TBJ.E.x + 0.5, TBJ.E.y)
	MOS:mosfet(up_ ,, LEDSQuB,S) with .G at Here; rlabel(,BS170,)
	resistor(up_ elen from MOS.D); rlabel(,R_{D},)
	dot; rlabel(,V_{DD},)
	line down_ 0.01 from MOS.S
	{
		line right_ 0.4
		capacitor(down_ 0.5); llabel(,C_{S},)
		line left_ 0.4
	}
	resistor(down_ 0.5); llabel(,R_{S},)
	line down_ 0.1
	dot; rlabel(,-V_{SS},)
	dot(at TBJ.E); rlabel(,V_E,)	
.PE



